package test;

class MonitorTask implements Runnable{
	private boolean flag = false; 
	private String word;
	
	public void stopMe(){
		flag=true;
	}
	public void sendWord(String word){
		this.word=word;
	}
	@Override
	public void run() {
		while(!flag){
			if(word.contains("alien")){
				System.out.println(Thread.currentThread().getName()+" found alien in "+word);
				break;
			}
		}
		System.out.println(Thread.currentThread().getName() + " stop");
	}
}
public class Main0702 {
	public static void main(String[] args) throws InterruptedException {
        //裁判程序代码
    }
}

